package com.feri.fc.controller;

import com.feri.fc.caregiver.service.PhysicianService;
import com.feri.fc.config.SystemConfig;
import com.feri.fc.param.PhysicianAdd;
import com.feri.fc.vo.R;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 千锋Java,为你而生！
 *
 * @Author: Feri
 * @Date:2024/11/26 11:03
 * @Modified:
 */
@RestController
@RequestMapping("api/physician")
@Tag(name = "陪诊师模块")
public class PhysicianController {
    @Resource
    private PhysicianService service;

    @PostMapping("add")
    public R add(@Validated @RequestBody PhysicianAdd add, HttpServletRequest request){
        return service.add(add,request.getIntHeader(SystemConfig.HEADER_UID));
    }
    @GetMapping("addpay")
    public R addPay(Integer id){

        return service.createPay(id);
    }
    @GetMapping("all")
    public R all(){
        return service.all();
    }
}
